

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
    <style>
    /* base */
    html,
    body,
    .container {
      width: 100%;
      height: 100%;
    }

    a,
    a:link,
    a:visited {
      text-decoration: none;
      color: inherit;
    }

    ul {
      list-style: none;
    }

    *,
    ::before,
    ::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    *:focus {
      outline: 0;
    }

    .container {
      display: flex;
      padding-top: 20px;
    }

    /* Nav */
    .container .doc-nav {
      position: fixed;
      height: 100%;
      margin: 0 30px 0 40px;
      width: 280px;
    }

    .doc-nav .nav-header {
      display: flex;
      align-items: center;
      box-sizing: border-box;
      background-color: rgb(240, 241, 242);
      height: 40px;
      padding: 16px;
      font-size: 18px;
      font-weight: 500;
      color: rgb(62, 64, 66);
      cursor: pointer;
    }

    .doc-nav .nav-content {
      height: calc(100% - 40px);
      overflow-y: auto;
      color: rgb(32, 34, 36);
    }

    .doc-nav .nav-content .nav-list,
    .doc-nav .nav-content .nav-sub-list {
      line-height: 1.5rem;
    }

    .doc-nav .nav-content .nav-label {
      display: inline-block;
      position: relative;
      padding: 2px 0 2px 20px;
      margin-bottom: 4px;
    }

    .doc-nav .nav-content .nav-sub-label {
      position: relative;
      padding: 2px 0 2px 40px;
      font-size: 14px;
    }

    .doc-nav .nav-content .nav-sub-label:hover {
      text-decoration: underline;
    }

    .doc-nav .nav-content .nav-list .nav-label.group::before {
      border-bottom: 0.25rem solid transparent;
      border-left: 0.25rem solid #6e7072;
      border-right: 0;
      border-top: 0.25rem solid transparent;
      content: '';
      display: block;
      height: 0;
      left: 0.5rem;
      position: absolute;
      top: 0.625rem;
      transition: transform 0.1s linear;
      width: 0;
    }

    .doc-nav .nav-content .nav-list .nav-label.group.active::before {
      transform: rotate(90deg);
    }

    /* doc content */
    .container .doc-content {
      position: fixed;
      height: 100%;
      width: calc(100% - 80px - 40px - 30px - 240px);
      right: 0%;
      overflow-y: auto;
    }

    .doc-title {
      border-bottom: 1px solid #dcdee0;
      font-size: 22px;
      margin: 8px 0 0;
      padding-bottom: 16px;
    }

    .doc-content h3 {
      font-size: 24px;
      font-weight: 600;
      margin: 24px 0;
    }

    .doc-content h4 {
      font-size: 22px;
      font-weight: 500;
      margin: 30px 0 8px;
    }

    .doc-content h4 span {
      color: #007d9c;
    }

    .doc-content .doc-declare {
      background-color: #fafafa;
      border-radius: 5px;
      border: 1px solid #ccc;
      font-size: 14px;
      overflow-x: auto;
      padding: 10px;
      tab-size: 4;
      line-height: 20px;
    }

    .doc-content .doc-comment {
      font-size: 16px;
      margin: 16px 0;
      line-height: 24px;
      word-break: break-word;
    }
  </style>

</head>
<body>
  <div class="container">
    <div class="doc-nav">
      <a href="#Documentation" class="nav-header">Documentation</a>
      <nav class="nav-content">
        <ul class="nav-list">
          <li>
            <a href="#includes" class="nav-label">Includes</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#netif/ppp/ppp_opts.h" class="nav-sub-label">netif/ppp/ppp_opts.h</a>
              </li>
      

              <li>
                <a href="#netif/ppp/pppcrypt.h" class="nav-sub-label">netif/ppp/pppcrypt.h</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#macros" class="nav-label">Macros</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#MPPE_H" class="nav-sub-label">MPPE_H</a>
              </li>
      

              <li>
                <a href="#MPPE_PAD" class="nav-sub-label">MPPE_PAD</a>
              </li>
      

              <li>
                <a href="#MPPE_MAX_KEY_LEN" class="nav-sub-label">MPPE_MAX_KEY_LEN</a>
              </li>
      

              <li>
                <a href="#MPPE_OPT_40" class="nav-sub-label">MPPE_OPT_40</a>
              </li>
      

              <li>
                <a href="#MPPE_OPT_128" class="nav-sub-label">MPPE_OPT_128</a>
              </li>
      

              <li>
                <a href="#MPPE_OPT_STATEFUL" class="nav-sub-label">MPPE_OPT_STATEFUL</a>
              </li>
      

              <li>
                <a href="#MPPE_OPT_56" class="nav-sub-label">MPPE_OPT_56</a>
              </li>
      

              <li>
                <a href="#MPPE_OPT_MPPC" class="nav-sub-label">MPPE_OPT_MPPC</a>
              </li>
      

              <li>
                <a href="#MPPE_OPT_D" class="nav-sub-label">MPPE_OPT_D</a>
              </li>
      

              <li>
                <a href="#MPPE_OPT_UNSUPPORTED" class="nav-sub-label">MPPE_OPT_UNSUPPORTED</a>
              </li>
      

              <li>
                <a href="#MPPE_OPT_UNKNOWN" class="nav-sub-label">MPPE_OPT_UNKNOWN</a>
              </li>
      

              <li>
                <a href="#MPPE_C_BIT" class="nav-sub-label">MPPE_C_BIT</a>
              </li>
      

              <li>
                <a href="#MPPE_D_BIT" class="nav-sub-label">MPPE_D_BIT</a>
              </li>
      

              <li>
                <a href="#MPPE_L_BIT" class="nav-sub-label">MPPE_L_BIT</a>
              </li>
      

              <li>
                <a href="#MPPE_S_BIT" class="nav-sub-label">MPPE_S_BIT</a>
              </li>
      

              <li>
                <a href="#MPPE_M_BIT" class="nav-sub-label">MPPE_M_BIT</a>
              </li>
      

              <li>
                <a href="#MPPE_H_BIT" class="nav-sub-label">MPPE_H_BIT</a>
              </li>
      

              <li>
                <a href="#MPPE_ALL_BITS" class="nav-sub-label">MPPE_ALL_BITS</a>
              </li>
      

              <li>
                <a href="#MPPE_OPTS_TO_CI(opts, ci)" class="nav-sub-label">MPPE_OPTS_TO_CI(opts, ci)</a>
              </li>
      

              <li>
                <a href="#MPPE_CI_TO_OPTS(ci, opts)" class="nav-sub-label">MPPE_CI_TO_OPTS(ci, opts)</a>
              </li>
      

              <li>
                <a href="#SHA1_PAD_SIZE" class="nav-sub-label">SHA1_PAD_SIZE</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#functions" class="nav-label">Functions</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#mppe_set_key" class="nav-sub-label">mppe_set_key</a>
              </li>
      

              <li>
                <a href="#mppe_init" class="nav-sub-label">mppe_init</a>
              </li>
      

              <li>
                <a href="#mppe_comp_reset" class="nav-sub-label">mppe_comp_reset</a>
              </li>
      

              <li>
                <a href="#mppe_compress" class="nav-sub-label">mppe_compress</a>
              </li>
      

              <li>
                <a href="#mppe_decomp_reset" class="nav-sub-label">mppe_decomp_reset</a>
              </li>
      

              <li>
                <a href="#mppe_decompress" class="nav-sub-label">mppe_decompress</a>
              </li>
      
            </ul>
            
          </li>
          <li>
            <a href="#vars" class="nav-label">Vars</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#consts" class="nav-label">Consts</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#types" class="nav-label">Types</a>
            
            <ul class="nav-sub-list">
            
            </ul>
            
          </li>
          <li>
            <a href="#typedefs" class="nav-label">Typedefs</a>
             
            <ul class="nav-sub-list">

              <li>
                <a href="#ppp_mppe_state;
" class="nav-sub-label">ppp_mppe_state;
</a>
              </li>
      
            </ul>
            
          </li>
        </ul>
      </nav>
    </div>
    <div class="doc-content">
      <h2 id="Documentation" class="doc-title">Documentation</h2>
      <h3 id="includes">Includes</h3>
      

      <h4 id="netif/ppp/ppp_opts.h"><span>netif/ppp/ppp_opts.h</span></h4>
      <pre class="doc-declare"><code>#include "netif/ppp/ppp_opts.h"
</code></pre>
      <pre class="doc-comment">#include "netif/ppp/ppp_opts.h"
</pre>

      <h4 id="netif/ppp/pppcrypt.h"><span>netif/ppp/pppcrypt.h</span></h4>
      <pre class="doc-declare"><code>#include "netif/ppp/pppcrypt.h"
</code></pre>
      <pre class="doc-comment">#include "netif/ppp/pppcrypt.h"
</pre>
      <h3 id="macros">Macros</h3>
      

      <h4 id="MPPE_H">Marco <span>MPPE_H</span></h4>
      <pre class="doc-declare"><code>#define MPPE_H
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_PAD">Marco <span>MPPE_PAD</span></h4>
      <pre class="doc-declare"><code>#define MPPE_PAD	4 /* MPPE growth per frame */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_MAX_KEY_LEN">Marco <span>MPPE_MAX_KEY_LEN</span></h4>
      <pre class="doc-declare"><code>#define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_OPT_40">Marco <span>MPPE_OPT_40</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPT_40	1 /* 40 bit */
</code></pre>
      <pre class="doc-comment">/* option bits for ccp_options.mppe */</pre>

      <h4 id="MPPE_OPT_128">Marco <span>MPPE_OPT_128</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPT_128	2 /* 128 bit */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_OPT_STATEFUL">Marco <span>MPPE_OPT_STATEFUL</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPT_STATEFUL 4 /* stateful mode */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_OPT_56">Marco <span>MPPE_OPT_56</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPT_56	8 /* 56 bit */
</code></pre>
      <pre class="doc-comment">/* unsupported opts */</pre>

      <h4 id="MPPE_OPT_MPPC">Marco <span>MPPE_OPT_MPPC</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPT_MPPC	16 /* MPPC compression */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_OPT_D">Marco <span>MPPE_OPT_D</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPT_D	32 /* Unknown */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_OPT_UNSUPPORTED">Marco <span>MPPE_OPT_UNSUPPORTED</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPT_UNSUPPORTED (MPPE_OPT_56|MPPE_OPT_MPPC|MPPE_OPT_D)
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_OPT_UNKNOWN">Marco <span>MPPE_OPT_UNKNOWN</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPT_UNKNOWN 64 /* Bits !defined in RFC 3078 were set */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_C_BIT">Marco <span>MPPE_C_BIT</span></h4>
      <pre class="doc-declare"><code>#define MPPE_C_BIT	1 /* MPPC */
</code></pre>
      <pre class="doc-comment">/*
 * This is not nice ... the alternative is a bitfield struct though.
 * And unfortunately, we cannot share the same bits for the option
 * names above since C and H are the same bit.  We could do a u_int32
 * but then we have to do a lwip_htonl() all the time and/or we still need
 * to know which octet is which.
 */</pre>

      <h4 id="MPPE_D_BIT">Marco <span>MPPE_D_BIT</span></h4>
      <pre class="doc-declare"><code>#define MPPE_D_BIT	16 /* Obsolete, usage unknown */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_L_BIT">Marco <span>MPPE_L_BIT</span></h4>
      <pre class="doc-declare"><code>#define MPPE_L_BIT	32 /* 40-bit */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_S_BIT">Marco <span>MPPE_S_BIT</span></h4>
      <pre class="doc-declare"><code>#define MPPE_S_BIT	64 /* 128-bit */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_M_BIT">Marco <span>MPPE_M_BIT</span></h4>
      <pre class="doc-declare"><code>#define MPPE_M_BIT	128 /* 56-bit, not supported */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_H_BIT">Marco <span>MPPE_H_BIT</span></h4>
      <pre class="doc-declare"><code>#define MPPE_H_BIT	1 /* Stateless (in a different byte) */
</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="MPPE_ALL_BITS">Marco <span>MPPE_ALL_BITS</span></h4>
      <pre class="doc-declare"><code>#define MPPE_ALL_BITS (MPPE_D_BIT|MPPE_L_BIT|MPPE_S_BIT|MPPE_M_BIT|MPPE_H_BIT)
</code></pre>
      <pre class="doc-comment">/* Does not include H bit; used for least significant octet only. */</pre>

      <h4 id="MPPE_OPTS_TO_CI(opts, ci)">Marco <span>MPPE_OPTS_TO_CI(opts, ci)</span></h4>
      <pre class="doc-declare"><code>#define MPPE_OPTS_TO_CI(opts, ci)	\
   do {				\
 u_char *ptr = ci; /* u_char[4] */ \
					\
 /* H bit */			\
 if (opts & MPPE_OPT_STATEFUL)	\
    *ptr++ = 0;		\
 else				\
    *ptr++ = MPPE_H_BIT;	\
 *ptr++ = 0;			\
 *ptr++ = 0;			\
					\
 /* S,L bits */			\
 *ptr = 0;			\
 if (opts & MPPE_OPT_128)	\
    *ptr |= MPPE_S_BIT;		\
 if (opts & MPPE_OPT_40)		\
    *ptr |= MPPE_L_BIT;		\
 /* M,D,C bits not supported */	\
   } while (/* CONSTCOND */ 0)
</code></pre>
      <pre class="doc-comment">/* Build a CI from mppe opts (see RFC 3078) */</pre>

      <h4 id="MPPE_CI_TO_OPTS(ci, opts)">Marco <span>MPPE_CI_TO_OPTS(ci, opts)</span></h4>
      <pre class="doc-declare"><code>#define MPPE_CI_TO_OPTS(ci, opts)	\
   do {				\
 const u_char *ptr = ci; /* u_char[4] */ \
					\
 opts = 0;			\
					\
 /* H bit */			\
 if (!(ptr[0] & MPPE_H_BIT))	\
    opts |= MPPE_OPT_STATEFUL;	\
					\
 /* S,L bits */			\
 if (ptr[3] & MPPE_S_BIT)	\
    opts |= MPPE_OPT_128;	\
 if (ptr[3] & MPPE_L_BIT)	\
    opts |= MPPE_OPT_40;	\
					\
 /* M,D,C bits */		\
 if (ptr[3] & MPPE_M_BIT)	\
    opts |= MPPE_OPT_56;	\
 if (ptr[3] & MPPE_D_BIT)	\
    opts |= MPPE_OPT_D;		\
 if (ptr[3] & MPPE_C_BIT)	\
    opts |= MPPE_OPT_MPPC;	\
					\
 /* Other bits */		\
 if (ptr[0] & ~MPPE_H_BIT)	\
    opts |= MPPE_OPT_UNKNOWN;	\
 if (ptr[1] || ptr[2])		\
    opts |= MPPE_OPT_UNKNOWN;	\
 if (ptr[3] & ~MPPE_ALL_BITS)	\
    opts |= MPPE_OPT_UNKNOWN;	\
   } while (/* CONSTCOND */ 0)
</code></pre>
      <pre class="doc-comment">/* The reverse of the above */</pre>

      <h4 id="SHA1_PAD_SIZE">Marco <span>SHA1_PAD_SIZE</span></h4>
      <pre class="doc-declare"><code>#define SHA1_PAD_SIZE 40
</code></pre>
      <pre class="doc-comment">/* Shared MPPE padding between MSCHAP and MPPE */</pre>
      <h3 id="functions">Functions</h3>
      

      <h4 id="mppe_set_key">Func <span>mppe_set_key</span></h4>
      <pre class="doc-declare"><code>void mppe_set_key(ppp_pcb *pcb, ppp_mppe_state *state, u8_t *key);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mppe_init">Func <span>mppe_init</span></h4>
      <pre class="doc-declare"><code>void mppe_init(ppp_pcb *pcb, ppp_mppe_state *state, u8_t options);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mppe_comp_reset">Func <span>mppe_comp_reset</span></h4>
      <pre class="doc-declare"><code>void mppe_comp_reset(ppp_pcb *pcb, ppp_mppe_state *state);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mppe_compress">Func <span>mppe_compress</span></h4>
      <pre class="doc-declare"><code>err_t mppe_compress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb, u16_t protocol);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mppe_decomp_reset">Func <span>mppe_decomp_reset</span></h4>
      <pre class="doc-declare"><code>void mppe_decomp_reset(ppp_pcb *pcb, ppp_mppe_state *state);</code></pre>
      <pre class="doc-comment"></pre>

      <h4 id="mppe_decompress">Func <span>mppe_decompress</span></h4>
      <pre class="doc-declare"><code>err_t mppe_decompress(ppp_pcb *pcb, ppp_mppe_state *state, struct pbuf **pb);</code></pre>
      <pre class="doc-comment"></pre>
      <h3 id="vars">Vars</h3>
      
      <h3 id="consts">Consts</h3>
      
      <h3 id="types">Types</h3>
      
      <h3 id="typedefs">Typedefs</h3>
      

      <h4 id="ppp_mppe_state;
">Typedef <span>ppp_mppe_state;
</span></h4>
      <pre class="doc-declare"><code>typedef struct ppp_mppe_state {
 lwip_arc4_context arc4;
 u8_t master_key[MPPE_MAX_KEY_LEN];
 u8_t session_key[MPPE_MAX_KEY_LEN];
 u8_t keylen;               /* key length in bytes */
 /* NB: 128-bit == 16, 40-bit == 8!
	 * If we want to support 56-bit, the unit has to change to bits
	 */
 u8_t bits;                 /* MPPE control bits */
 u16_t ccount;              /* 12-bit coherency count (seqno)  */
 u16_t sanity_errors;       /* take down LCP if too many */
 unsigned int stateful :1; /* stateful mode flag */
 unsigned int discard  :1; /* stateful mode packet loss flag */
} ppp_mppe_state;
</code></pre>
      <pre class="doc-comment">/*
 * State for an MPPE (de)compressor.
 */</pre>
    </div>
  </body>
</html>
            